<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//后台路由文件
require_once  app_path('Http/Route').'/admin.php';


//a成员的路由



Route::get('/', function () {
    return view('welcome');
});


//post
Route::post('t1', function () {
    echo 'post';
    /* echo "<pre>";
     print_r(get_included_files());*/
});
//get
Route::get('t1', function () {
    echo 'hello';
    /* echo "<pre>";
     print_r(get_included_files());*/
});

//any
Route::any('t2', function () {
    echo 'any';
    /* echo "<pre>";
     print_r(get_included_files());*/
});
//可选参数
Route::any('t3/{name?}', function ($name='186') {
    echo $name;
});
//参数限制
Route::get('t3/{name?}', function ($name='186') {
    echo $name;
})->where('name','[a-z]+');

//访问控制器
Route::get('t4/{num}','ArticleController@say');

//隐士控制器
Route::controller('t5','ArticleController');


//资源路由
Route::resource('art','ArticleController');

/*
 * art  -> ArticleController@index
 * art/12  -> ArticleController@show
 * art/12/edit  -> ArticleController@edit
 *
 * post
 * art  -> ArticleController@store
 *
 * put
 * art/12  -> ArticleController@update
 * delete
 * art/12  -> ArticleController@destroy
 */

//登录注册路由
// 认证路由...
Route::get('auth/login', 'Auth\AuthController@getLogin');
Route::post('auth/login', 'Auth\AuthController@postLogin');
Route::get('auth/logout', 'Auth\AuthController@getLogout');
// 注册路由...
Route::get('auth/register', 'Auth\AuthController@getRegister');
Route::post('auth/register', 'Auth\AuthController@postRegister');